HAL MDF migration: List of applicable concepts ¶
This section provides information about the HAL MDF applicable architecture concepts.
In HAL1, a single driver handles both MDF and ADF peripherals. In HAL2, the MDF driver has been split into two separate drivers MDF and ADF. This separation enhances maintainability and modularity.
All these MDF concepts are applicable also for ADF. Simply replace MDF with ADF to get the corresponding ADF concepts. For more details, see : MDF specific concept
Concepts for MDF ¶
|
Concept |
Description |
|---|---|
|
The initialization has been split into separate init and config functions:
each block of the MDF have its own configuration function example:
|
|
|
Removal and conversion of init structure to configuration structure |
The structure
|
|
The handle structure has been renamed to
|
|
|
|
|
|
New APIs are available to set and get MDF features. |
|
|
The
|
|
|
Two functions to Set/Get User Data are available:
|
|
|
Individual callback registration APIs replace global register and unregister functions |
The registration of callbacks for MDF events is managed by dedicated functions. Each function is responsible for registering callback functions for specific MDF events. |
|
In HAL2, the HAL MDF and ADF driver provides several state machines, one per block. |
|
|
The HAL MDF functions were updated to return:
|
|
|
New APIs for filtering optional asynchronous process interrupts |
New APIs are provided in the MDF to filter and manage asynchronous process interrupts :
|
|
All TypeDef parts in MDF have been removed and replaced by
|
|
|
Adding const keyword to non-modifiable pointers ensures that either the pointer itself or the data it points to cannot be modified. This enhances code safety and readability. |
|
|
The parameters and state are checked using
|
|
|
Add HAL PPP Services for Drivers with Handle to Retrieve Corresponding Peripheral Clock Frequency. |
HAL MDF provides new API to retrieve clock frequency:
|
|
Replace Finite Parameter Defines (Including PPP Instances) with Enum Types at HAL Levels. |
Finite parameters (including MDF instances) have been converted into enumerated types (enums) at the HAL level. This improves code readability, maintainability, and type safety. |
|
In HAL2, the implementation of
|
|
|
Add HAL_PPP Prefix to All HAL Peripheral APIs (Defines, Macros, Types, and Functions). |
All HAL MDF functions start with
|